package com.sgb.kjwl.view.ui.adapter.business;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.business.MemberEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class ImgListAdapter extends BaseRecycleAdapter<String> {

    private ImageView ivImg;
    public ImgListAdapter(Context context, List<String> datas) {
        super(context, R.layout.item_img, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final String url) {
        holder.setBinding(BR.viewModel, url);
        ivImg = holder.getItem().findViewById(R.id.iv_img);

        Glide.with(context).load(url).into(ivImg);
    }

    private ImgListAdapter.onEditClickListener editClickListener;

    public void setonEditClick(ImgListAdapter.onEditClickListener editClickListener) {
        this.editClickListener = editClickListener;
    }

    public interface onEditClickListener {
        void onDetailedListClick(MemberEntity entity, int position);

        void onInviteOfferClick(MemberEntity entity, int position);
    }
}
